package com.minimalist.common.config.mybatis.bo;

import java.util.Objects;

/**
 * 分页请求
 *
 * @author 11987
 */
public class PageReq{

    /**
     * 页码
     */
    private Long pageNum = 1L;

    /**
     * 分页条数 默认10条
     */
    private Long pageSize = 10L;

    public PageReq(Long pageNum, Long pageSize){
        this.pageNum = pageNum;
        this.pageSize = pageSize;
    }

    public PageReq(){
    }

    public Long getPageNum(){
        return pageNum;
    }

    public void setPageNum(Long pageNum){
        this.pageNum = pageNum;
    }

    public Long getPageSize(){
        return pageSize;
    }

    public void setPageSize(Long pageSize){
        this.pageSize = pageSize;
    }

    @Override
    public boolean equals(Object o){
        if (this == o){
            return true;
        }
        if (o == null || getClass() != o.getClass()){
            return false;
        }
        PageReq pageReq = (PageReq) o;
        return Objects.equals(pageNum, pageReq.pageNum) && Objects.equals(pageSize, pageReq.pageSize);
    }

    @Override
    public int hashCode(){
        return Objects.hash(pageNum, pageSize);
    }

    @Override
    public String toString(){
        return "PageReq{" +
                "pageNum=" + pageNum +
                ", pageSize=" + pageSize +
                '}';
    }
}
